package org.example.myleet.p1656;

import org.example.myleet.Utils.Assert;
import org.example.myleet.Utils.JsonUtils;

public class Main {
    public static void main(String[] args) {
        OrderedStream orderedStream = new OrderedStream(5);
        Assert.isTrue("[]".equals(JsonUtils.toJson(orderedStream.insert(3, "ccccc"))));
        Assert.isTrue("[\"aaaaa\"]".equals(JsonUtils.toJson(orderedStream.insert(1, "aaaaa"))));
        Assert.isTrue("[\"bbbbb\",\"ccccc\"]".equals(JsonUtils.toJson(orderedStream.insert(2, "bbbbb"))));
        Assert.isTrue("[]".equals(JsonUtils.toJson(orderedStream.insert(5, "eeeee"))));
        Assert.isTrue("[\"ddddd\",\"eeeee\"]".equals(JsonUtils.toJson(orderedStream.insert(4, "ddddd"))));
    }
}
